package com.moorror.cola.strategy.plugin.view.component;

import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.ex.CheckboxAction;
import org.jetbrains.annotations.NotNull;

/**
 * @Author jiyanghuang
 * @Date 2022/3/17 12:32 AM
 */
public class CSCheckbox extends CheckboxAction {

    private boolean currentState = true;

    private String tipText;

    public CSCheckbox(String tipText) {
        super("", tipText, null);
        this.tipText = tipText;
    }

    @Override
    public boolean isSelected(@NotNull AnActionEvent e) {
        System.out.println("select--->" + currentState);
        return currentState;
    }

    @Override
    public void setSelected(@NotNull AnActionEvent e, boolean state) {
        System.out.println("state--->" + state);
        this.currentState = state;
    }

    public boolean isState() {
        return currentState;
    }

    public boolean isCurrentState() {
        return currentState;
    }

    public void setCurrentState(boolean currentState) {
        this.currentState = currentState;
    }
}
